<?php

defined('o') || exit('404 not find file'); //防跳墙

class XML {
	private $tamplet = '';
	public function get_val($dir,$name) {
                $bool = false;
		foreach($this -> tamplet as $temp) {
                        if($temp['tag']==strtoupper($dir) && $temp['type'] == 'open'){
                                $bool = true;
                        }
                        if($temp['tag']==strtoupper($name) && $bool == true){
                                return $temp['value'];
                        }
		} 
	} 
	public function __construct($val = 'default') {
		$str = file_get_contents(ROOT . "\\templet\\$val\\$val.xml");
		$x = xml_parser_create();
		xml_parse_into_struct($x, $str, $index);
                xml_parser_free($x);
		$this -> tamplet = $index;
	} 
} 

?>